if (chrome.extension.onMessage) chrome.extension.onMessage.addListener(listener); else chrome.extension.onRequest.addListener(listener);